<?php


Route::group(['namespace' => 'Api'], function() {
    Route::get('/','VideoController@getVideoLists');//视频列表
    Route::get('video/info','VideoController@getVideoInfo');
    Route::get('video/info/list','VideoController@getVideoInfoList');

    Route::get('video/category','VideoController@getVideoCategory');//视频分类信息
    Route::get('video/category/list','VideoController@getVideoCategoryList');//视频分类列表

    Route::get('video/category/good','VideoController@getVideoCategoryGood');//视频分类推荐
});


Route::get('test','TestController@index');//测试抓取评论



//https://ash.xiegangsir.com/api/push
//xv2evuoxexkqn03ua2kbods2jngktxdy  //Token
//qc3JOkHgaQgQIwARanCafXazzTLAsZ7Sf7JkgugZYRB  AES

Route::group(['prefix' => 'v2'], function() {
    Route::get('/',function (){
        return '小样，请不要偷看了';
    });

    //不需要登录
    Route::post('login',   'AuthController@login');//登录
    Route::post('refresh', 'AuthController@refresh');//刷新token

    Route::any('push',   'PushController@index');//消息推送

    //统计指定操作数据
    Route::post('count','CountController@update');//更新数据统计

    //需要登录
    Route::group(['middleware' => 'auth:api'], function(){
        //用户
        Route::group(['prefix' => 'user'], function(){
            Route::get ('/','UserController@user');//用户信息
            Route::get ('follows','UserController@follows');//用户关注列表
            Route::get ('follow/list','UserController@userFollows');//用户关注列表
            Route::get ('history','UserController@history');//用户播放记录
            Route::post('update','UserController@update');//用户播放记录
        });
        //关注
        Route::group(['prefix' => 'follow'], function(){
            Route::post('/','FollowController@index');//关注/取消关注分类
        });

        //评论
        Route::group(['prefix' => 'comment'], function(){
            Route::get ('/','CommentController@index');//评论列表
            Route::post('replay','CommentController@replay');//评论视频
        });


        //点赞（评论）
        Route::group(['prefix' => 'praise'], function(){
            Route::get ('/','PraiseController@index');//点赞列表（评论）
            Route::post('store','PraiseController@store');//点赞评论（评论）
        });

        //视频列表
        Route::group(['prefix' => 'video'], function(){
            Route::get ('/',   'VideoController@index');//视频列表
            Route::get ('info','VideoController@info');//视频详情
            Route::get ('list','VideoController@list');//视频详情列表
            Route::post('share','VideoController@share');//统计分享次数
            Route::get ('rand/list','VideoController@randList');//视频详情列表
            Route::post ('zan','VideoController@zan');//点赞（视频）
            Route::post ('collect','VideoController@collect');//收藏（视频）
            Route::get ('collect/list','VideoController@collectList');//获取个人收藏列表（视频）
            Route::get ('wheel/list','VideoController@wheelList');//获取首页视频轮播列表（视频）
        });

        //分类
        Route::group(['prefix' => 'cate'], function(){
            Route::get ('/','CateController@index');//分类列表
            Route::get ('info','CateController@info');//分类详情
            Route::get ('video','CateController@video');//分类视频列表
        });

        //收集formid
        Route::post('form','FormController@index');//分类列表

        //任务
        Route::group(['prefix' => 'task'], function(){
            Route::get ('/','TaskController@index');//获取个人当天任务信息
            Route::post ('finish','TaskController@finish');//提交任务
            Route::get ('config','TaskController@config');//获取任务配置信息
            Route::get ('score_log','TaskController@scoreLog');//获取个人任务积分记录
        });

        //商城
        Route::group(['prefix' => 'shop'], function(){
            Route::get ('/','ShopController@index');//获取商品列表
            Route::get ('info','ShopController@info');//获取商品详情
        });

        //商城-订单
        Route::group(['prefix' => 'order'], function(){
            Route::get ('/','OrderController@index');//获取商品订单列表
            Route::post ('add','OrderController@add');//创建订单
            Route::post ('update','OrderController@update');//修改订单信息
            Route::delete ('delete','OrderController@delete');//删除订单
            Route::post ('buy','OrderController@buy');//支付订单
        });

        //地址
        Route::group(['prefix' => 'address'], function(){
            Route::get ('/','AddressController@index');//获取个人地址列表信息
            Route::post ('update','AddressController@update');//更新个人地址列表信息
        });

        //配置信息
        Route::group(['prefix' => 'config'], function(){
            Route::get ('/','ConfigController@index');
            Route::get ('share_img','ConfigController@getShareImg'); //获取分享主题图片
        });
    });


});
Route::group(['prefix' => 'v3','namespace' => 'v3'], function() {
    Route::get('/',function (){
        return '小样，请不要偷看了';
    });

    //不需要登录
    Route::post('login',   'AuthController@login');//登录
    Route::post('refresh', 'AuthController@refresh');//刷新token

    //统计指定操作数据
    Route::post('count','CountController@update');//更新数据统计

    //视频列表
    Route::group(['prefix' => 'video'], function(){
        Route::get ('/',   'VideoController@index');//视频列表
        Route::get ('take',   'VideoController@indexTake');//视频列表(不分页)
        Route::get ('rand/list','VideoController@randList');//视频详情列表
        Route::get ('info','VideoController@info');//视频详情
        Route::get ('list','VideoController@list');//视频详情列表
        Route::post('share','VideoController@share');//统计分享次数
    });

    //分类
    Route::group(['prefix' => 'cate'], function(){
        Route::post ('/','CateController@index');//分类列表
        Route::post ('info','CateController@info');//分类详情
        Route::post ('video','CateController@video');//分类视频列表
    });

    Route::post ('user','UserController@user');//用户信息

    //收集formid
    Route::post('form','FormController@index');//分类列表
    Route::post ('task/finish','TaskController@finish');//提交任务

    Route::post ('log','LogTimeController@index');//统计相应时间
    //配置信息
    Route::get ('config','ConfigController@index');
});
